package com.leantech.android.browser

import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.updateAndGet
import kotlinx.coroutines.launch
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject

class HotSplashAdState : KoinComponent {

    private val appScope by inject<CoroutineScope>()

    val hotSplashCountFlow = MutableStateFlow(0)

    fun requestAdShow() {
        appScope.launch {
            hotSplashCountFlow.emit(1)
        }
    }

    fun reset() {
        appScope.launch {
            hotSplashCountFlow.emit(0)
        }
    }

}